<?php

namespace App\Http\Requests;
/**
 * 微信支付-表单验证类
 * @package App\Http\Requests
 */
class AdminWxMpPayListPost extends AdminBaseRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'nick_name' => 'required',
            'head_img' => 'required',
            'appid' => 'required',
            'mch_id' => 'required',
            'key' => 'required',
            'cert_path' => 'required',
            'key_path' => 'required',
            'is_enable' => 'in:0,1',
            'is_default' => 'in:0,1',
        ];
    }
    /**
     * 定义错误消息
     * @return array
     */
    public function messages()
    {
        return [
            'nick_name.required' => '请填写应用名称',
            'head_img.required' => '请上传应用头像',
            'appid.required' => '请输入微信应用ID',
            'mch_id.required' => '请输入商户号',
            'key.required' => '请输入商户API密钥',
            'cert_path.required' => '请填写商户API证书cert路径',
            'key_path.required' => '请填写商户API证书key路径',
            'is_enable.in' => '请选择应用使用状态',
            'is_default.in' => '请选择默认状态',
        ];
    }
}
